package com.ytjj.qmyx.admin.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.admin.annotation.OperLog;
import com.ytjj.qmyx.admin.constants.SysLogConstants;
import com.ytjj.qmyx.admin.model.request.BankerProductRequest;
import com.ytjj.qmyx.admin.service.BankerProductImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 *
 * @Version: 1.0
 *
 * 供应商产品库-商品图片
 */
@RestController
@RequestMapping("/bankerImg")
public class BankerProductImgController {

    @Autowired
    private BankerProductImgService bankerProductImgService;

    @PostMapping("/list")
    @OperLog(operModule = "供应商产品库-商品图片", operDesc = "图片列表", operType = SysLogConstants.OPERATION_SELECT)
    public CommonResult getImgList(@RequestBody BankerProductRequest bankerProductRequest) {
        return CommonResult.success(bankerProductImgService.getImgList(bankerProductRequest));
    }

    @PostMapping("/oneClickView")
    @OperLog(operModule = "供应商产品库-商品图片", operDesc = "一键查看", operType = SysLogConstants.OPERATION_SELECT)
    public CommonResult oneClickView(@RequestBody BankerProductRequest bankerProductRequest) {
        return CommonResult.success(bankerProductImgService.oneClickView(bankerProductRequest.getProductId(), bankerProductRequest.getType()));
    }

}
